<div class="box box-solid no-margin box-show">
    <div class="box-body">
        <h4>箱唛</h4>
        <div class="box-body table-responsive no-padding">
            <table class="table">
                <thead>
                <tr>
                    <th>名称</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                @if($delivery->marks->isNotEmpty())
                    @foreach($delivery->marks as $item)
                        <tr>
                            <td>{{ $item->marks_name }}</td>
                            <td>
                                <a href="{{ url('uploads/'.$item->d_marks) }}" target="_blank" class="btn btn-sm btn-default"><i class="fa fa-download"></i> 下载</a>
                                @if($delivery->status <= 4)
                                    <button class="btn btn-sm btn-default marks_del" data-id="{{ $id.'-'.$item->id }}"><i class="fa fa-remove"></i>删除</button>
                                @endif
                            </td>
                        </tr>
                    @endforeach
                @endif
                </tbody>
            </table>
        </div>
    </div>
</div>
<script language="JavaScript" type="text/javascript">
    $(function () {
        $('.marks_delete').on('click', function () {
            var id = $(this).data('id');
            $.ajax({
                method: 'post',
                url: '/xqc/delivery/fba-ajax',
                data: {
                    _token: "{{ csrf_token() }}",
                    action: 'delMarks',
                    param: id
                },
                success: function (data) {
                    if (typeof data === 'object') {
                        if (data.status) {
                            toastr.success('提交成功 !');
                            $.pjax.reload('#fba-form');
                        } else {
                            swal(data.message, '', 'error');
                        }
                    }
                }
            });
        });
    });
</script>
